﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CaiyinSoft.NetGather.Protocol;

namespace CaiyinSoft.NetGather.NetGatherLib.Publisher
{
    public partial class TextHTMLPublisherForm : InnerFormBase
    {
        public TextHTMLPublisherForm()
        {
            InitializeComponent();
            this.TopLevel = false;
        }

        private TextHTMLPublisher _HTMLPublisher;
        public TextHTMLPublisher HTMLPublisher
        {
            get
            {
                if (_HTMLPublisher == null)
                {
                    return null;
                }
                else
                {
                    _HTMLPublisher.SavePath = SavePath;
                    return _HTMLPublisher;
                }
            }
            set
            {
                _HTMLPublisher = value;
                SavePath = value.SavePath;
            }
        }

        public string SavePath
        {
            get
            {
                return txtFilePath.Text;
            }
            set
            {
                txtFilePath.Text = value;
            }
        }

        private void btFile_Click(object sender, EventArgs e)
        {
            SaveFileDialog fd = new SaveFileDialog();
            fd.Filter = "text|*.text";
            DialogResult res= fd.ShowDialog();
            if (res != DialogResult.OK) return;

            txtFilePath.Text = fd.FileName;
        }
    }
}
